﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Kaiser.Modules.Core.Services;

namespace Kaiser.Modules.Core
{
    public  class CoreServiceFactory
    {
        /// <summary>
        /// 用户服务
        /// </summary>
        /// <returns></returns>
        public static UserService CreateUserService()
        {
            return new UserService();
        }

        /// <summary>
        /// 项目服务
        /// </summary>
        /// <returns></returns>
        internal static BalanceService CreateBalanceService()
        {
            return new BalanceService();
        }

        /// <summary>
        /// 资金流水
        /// </summary>
        /// <returns></returns>
        internal static FlowBillsService CreateFlowBillsService()
        {
            return new FlowBillsService();
        }

        /// <summary>
        /// 销售订单服务
        /// </summary>
        /// <returns></returns>
        public static SaleOrderService CreateSaleOrderService()
        {
            return new SaleOrderService();
        }

        /// <summary>
        /// 销售服务
        /// </summary>
        /// <returns></returns>
        public static SaleService CreateSaleService()
        {
            return new SaleService();
        }


        /// <summary>
        /// 进货单服务
        /// </summary>
        /// <returns></returns>
        public static PurService CreatePurService()
        {
            return new PurService();
        }

        private static BillCodeService _billCodeService;
        /// <summary>
        /// 单据生成服务
        /// </summary>
        /// <returns></returns>
        public static BillCodeService CreateBillCodeService()
        {
            if (_billCodeService == null)
            {
                _billCodeService = new BillCodeService();
            }
            return _billCodeService;
        }
    }
}
